{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ title }}</title>
    <link rel="stylesheet" type="text/css" href="{% static 'Dashboard/report.css' %}">
</head>
<body>
<h1 id="_1">疫情防控数据分析报告</h1>
<p><strong>更新时间：{{ date }} &emsp;耗时：{{ time_consuming|floatformat:"2" }}秒</strong></p>

<hr/>

<p>本文档根据I莞工APP“疫情防控”问卷数据，从数据填报率、师生身体状况、师生分布、人员流动情况、师生返莞计划和师生感染风险等六个角度，分析我校目前疫情防控局势。</p>

<h2 id="_2">问卷内容说明</h2>
<p>“疫情防控”问卷包含身体状况、出行记录、居住地和接触史等方面的21个问题。</p>

<h2 id="_3">填报率</h2>
<h3 id="">总填报情况</h3>
<p>本次参与线上填报的有教职工{{ people1 | default:0 }}人（含国际教师{{ people2 | default:0 }}人），学生{{ people3 | default:0 }}人(含港澳台学生{{ people4 | default:0 }}人)，共{{ people5 | default:0 }}人。近5日的填报率如下表1，平均日填报率{{ avg_report_rate }}%。近5日的填报率如下表。</p>
<table>
    <thead>
    <tr>
        <th>填报日期</th>
        <th>填报人数</th>
        <th>未填报人数</th>
        <th>填报率</th>
        <th>未填报率</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, report_num, unreport_num, report_rate, unreport_rate in reporting_rate_in_recent_5_days %}
        <tr>
            <td>{{ submit_time }}</td>
            <td>{{ report_num }}</td>
            <td>{{ unreport_num }}</td>
            <td>{{ report_rate }}%</td>
            <td>{{ unreport_rate }}%</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
<h3 id="">二级组织填报情况</h3>
<table>
    <thead>
    <tr>
        <th>单位</th>
        <th>填报人数</th>
        <th>未填报人数</th>
        <th>未填报率</th>
        <th>单位总人数</th>
    </tr>
    </thead>
    <tbody>
    {% for yxmc,yes_count,no_count, no_rate, count in second_nocount %}
        <tr>
            <td>{{ yxmc | default:''}}</td>
            <td>{{ yes_count | default:count }}</td>
            <td>{{ no_count | default:0 }}</td>
            <td>{{ no_rate | default:100}}%</td>
            <td>{{ count | default:0}}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>


<!-- ------------------------------------疫情健康码、疫苗状况------------------------------------------ -->
<h2>师生健康码状态</h2>
<p>教职工上报健康码情况为： 绿码：{{green_tea}}人， 黄码：{{yellow_tea}}人，红码：{{red_tea}}人。红黄码人员如下 </p>
{% if healthy_status_detail_tea %}
    <table>
        <thead>
            <tr>
                <th>学工号</th>
                <th>姓名</th>
                <th>学院</th>
                <th>身体状况</th>
                <th>健康码状态</th>
                <th>手机</th>
            </tr>
        </thead>
        <tbody>
            {% for username, name, faculty_name, class_name, health_situation, health_code, sj in healthy_status_detail_tea %}
            <tr>
                <td>{{ username }}</td>
                <td>{{ name }}</td>
                <td>{{ faculty_name }}</td>
                <td>{{ health_situation }}</td>
                <td>{{ health_code }}</td>
                <td>{{ sj|default_if_none:'-' }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% else %}
    今日无红黄码教职工。
{% endif %}

<p>学生上报健康码情况为： 绿码：{{green_stu}}人， 黄码：{{yellow_stu}}人，红码：{{red_stu}}人。红黄码人员如下 </p>
{% if healthy_status_detail_stu %}
    <table>
        <thead>
            <tr>
                <th>学工号</th>
                <th>姓名</th>
                <th>学院</th>
                <th>班级</th>
                <th>身体状况</th>
                <th>健康码状态</th>
                <th>手机</th>
            </tr>
        </thead>
        <tbody>
            {% for username, name, faculty_name, class_name, health_situation, health_code, sj in healthy_status_detail_stu %}
            <tr>
                <td>{{ username }}</td>
                <td>{{ name }}</td>
                <td>{{ faculty_name }}</td>
                <td>{{ class_name }}</td>
                <td>{{ health_situation }}</td>
                <td>{{ health_code }}</td>
                <td>{{ sj |default_if_none:'-'}}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% else %}
    今日无红黄码学生。
{% endif %}

<h2>管控区域情况</h2>
<p>教职工处于管控区域情况： 其中处于封闭区{{in_controllerd_area1_tea}}人， 处于封控区{{in_controllerd_area2_tea}}人</p>
<p>学生处于管控区域情况： 其中处于封闭区{{in_controllerd_area1_stu}}人， 处于封控区{{in_controllerd_area2_stu}}人</p>

<h2>师生疫苗接种情况</h2>
<p>教职工疫苗接种情况： 其中{{ym_two_tea}}人已完成两针， {{ym_one_tea}}人已完成一针， {{ym_no_normal_tea}}人未接种， {{ym_no_error_tea}}人有疫苗接种禁忌</p>
<p>学生疫苗接种情况： 其中{{ym_two_stu}}人已完成两针， {{ym_one_stu}}人已完成一针， {{ym_no_normal_stu}}人未接种， {{ym_no_error_stu}}人有疫苗接种禁忌</p>
<!----------------------------------------疫情健康码、疫苗状况结束-------------------------------------------------->


<h2 id="_4">师生身体情况</h2>
{% if sql_8 %}
    <p>今日新增{{ sql_8 | length }}人身体不适，如下表：</p>
    <table>
        <thead>
        <tr>
            <th>学工号</th>
            <th>姓名</th>
            <th>单位</th>
            <th>居住地</th>
            <th>手机号</th>
            <th>身体情况</th>
        </tr>
        </thead>
        <tbody>
        {% for username, name, faculty_name, current_area, sj, health_situation in sql_8 %}
            <tr>
                <td>{{ username }}</td>
                <td>{{ name }}</td>
                <td>{{ faculty_name }}</td>
                <td>{{ current_area }}</td>
                <td>{{ sj }}</td>
                <td>{{ health_situation }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
    今日无新增身体不适人员。
{% endif %}

<p>近5日身体不适人数如下表所示。</p>
<table>
    <thead>
    <tr>
        <th>填报日期</th>
        <th>健康</th>
        <th>发热</th>
        <th>咳嗽</th>
        <th>头晕</th>
        <th>腹泻</th>
        <th>乏力</th>
        <th>多种或其他症状</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, good, fever, cough, shortness_of_breath, other, dizziness, diarrhea, weak in physical_condition_of_teachers_and_students_in_recent_5_days %}
        <tr>
            <td>{{ submit_time }}</td>
            <td>{{ good }}</td>
            <td>{{ fever }}</td>
            <td>{{ cough }}</td>
            <td>{{ dizziness }}</td>
            <td>{{ diarrhea }}</td>
            <td>{{ weak }}</td>
            <td>{{ other }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>

{% if sql_16 %}
    <p>
        截止至昨日23:59，连续7天身体不适的人有{{ unhealth | default:0 }}人，其中，发热发热{{ fever | default:0 }}人，咳嗽{{ caugh | default:0 }}人，气促{{ shortness_of_breath | default:0 }}人，多种或其他症状{{ other | default:0 }}人</p>
    <p>具体名单如下：</p>
    <table>
        <thead>
        <tr>
            <th>学工号</th>
            <th>姓名</th>
            <th>单位</th>
            <th>居住地</th>
            <th>手机号</th>
            <th>身体状况</th>
        </tr>
        </thead>
        <tbody>
        {% for submit_time, username, name, faculty_name, current_city, sj, health_situation in sql_16 %}
            <tr>
                <td>{{ username }}</td>
                <td>{{ name }}</td>
                <td>{{ faculty_name | default:'-'}}</td>
                <td>{{ current_city | default:'-' }}</td>
                <td>{{ sj | default:'-' }}</td>
                <td>{{ health_situation }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
    <p>无人连续5天身体不适</p>
{% endif %}


<h2 id="_5">师生分布</h2>
{% if True %}
<div id="sql_21" style="width: auto;height:400px;page-break-inside: avoid;"></div>
{% endif %}
<h3 id="">境内重点地区</h3>
<p>东莞市政府将 {%for label,label2 in importment_area %} {{ label }} {% endfor %}等{{ importment_area_count }}个地级市列为疫情重点关注地区。</p>
<p>我校师生主要分布在 {% for place, count, rate in top_cities %} {{ place }}（{{ count | default:0 }}人，{{ rate }}%）  {% endfor %}
    。在疫情重点关注地区中共有我校学生{{ ill_area_stuCount | default:0 }}人，教师{{ ill_area_teaCount | default:0 }}人。{% if ill_area_stuCount or ill_area_teaCount %}具体分布如下表。</p>
<table>
    <thead>
    <tr>
        <th>地区</th>
        <th>学生人数</th>
        <th>教师人数</th>
    </tr>
    </thead>
    <tbody>
    {% for city, student_count, teacher_count in sql_10 %}
        <tr>
            <td>{{ city }}</td>
            <td>{{ student_count | default:0 }}</td>
            <td>{{ teacher_count | default:0 }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
{% endif %}
<h3 id="">境外重点地区</h3>

{% if foreign_count %}
    <p>
        根据3月4日境外疫情变化动态调整隔离观察政策。凡是从韩国、意大利、伊朗、日本等疫情严重国家经广东口岸入境的，或经其他国家或地区从广东口岸入境且过去14天有日本，韩国，意大利，伊朗等疫情严重国家旅行史、居住史的旅客，如果是中转去省外的，严格按当地规定做好防疫工作；
        <br>
        根据科教局最新通知。从3月13日起（按入境时间）起原四国(日本，韩国，意大利，伊朗)返莞隔离改为八国，增加了西班牙、法国、德国、美国
        <br>
        3月20日新增三个境外国家英国、泰国、菲律宾
        <br>
        境外全是重点地区
    <p>具体分布名单如下：</p>
    <table>
        <thead>
        <tr>
            <th>国家</th>
            <th>学生人数</th>
            <th>教师人数</th>
        </tr>
        </thead>
        <tbody>
        {% for country, student_count, teacher_count in foreign_count %}
            <tr>
                <td>{{ country }}</td>
                <td>{{ student_count | default:0 }}</td>
                <td>{{ teacher_count | default:0 }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
    <p>无在境外重点地区人员</p>
{% endif %}

<h3 id="">重点地区流入流出情况</h3>

<h2 id="_6">师生流动情况</h2>
<p>今日教职工流动情况</p>
<table>
    <thead>
    <tr>
        <th>流动人数</th>
        <th>流动率</th>
        <th>第一流入城市</th>
        <th>第二流入城市</th>
        <th>第三流入城市</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>{{ func15_tea.sum }}</td>
        <td>{{ func15_tea.rate }}‰</td>
        {% for city_name, num in func15_tea.cities %}
        <td>{{ city_name }}{{ num | default:0 }}人</td>
        {% endfor %}
    </tr>
    </tbody>
</table>

<p>今日学生流动情况</p>
<table>
    <thead>
    <tr>
        <th>流动人数</th>
        <th>流动率</th>
        <th>第一流入城市</th>
        <th>第二流入城市</th>
        <th>第三流入城市</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>{{ func15_stu.sum }}</td>
        <td>{{ func15_stu.rate }}‰</td>
        {% for city_name, num in func15_stu.cities %}
        <td>{{ city_name }}{{ num | default:0 }}人</td>
        {% endfor %}
    </tr>
    </tbody>
</table>


<h2 id="">重点地区流入情况</h2>

{% if sql_11_tea %}
<p>今日教职工共有{{ sql_11_tea | length }}人流入疫情重点关注地区。具体人员如下：</p>
<table>
    <thead>
    <tr>
        <th>学工号</th>
        <th>姓名</th>
        <th>单位</th>
        <th>身体状况</th>
        <th>手机</th>
        <th>前一日所在日</th>
        <th>现今所在地</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, username, name, faculty_name, health_condition, sj, yesterday_country, yesterday_province, yesterday_city, yesterday_district, today_country, today_province, today_city, today_district in sql_11_tea %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ sj }}</td>
        <td>{{ yesterday_country | default:'' }}{{ yesterday_province | default:'' }}{{ yesterday_city | default:'' }}{{ yesterday_district | default:'' }}</td>
        <td>{{ today_country | default:'' }}{{ today_province | default:'' }}{{ today_city | default:'' }}{{ today_district | default:'' }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>今日教职工无人流入疫情重点关注地区</p>
{% endif %}



{% if sql_11_stu %}
<p>今日学生共有{{ sql_11_stu | length }}人流入疫情重点关注地区。具体人员如下：</p>
<table>
    <thead>
    <tr>
        <th>学工号</th>
        <th>姓名</th>
        <th>单位</th>
        <th>身体状况</th>
        <th>手机</th>
        <th>前一日所在日</th>
        <th>现今所在地</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, username, name, faculty_name, health_condition, sj, yesterday_country, yesterday_province, yesterday_city, yesterday_district, today_country, today_province, today_city, today_district in sql_11_stu %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ sj }}</td>
        <td>{{ yesterday_country | default:'' }}{{ yesterday_province | default:'' }}{{ yesterday_city | default:'' }}{{ yesterday_district | default:'' }}</td>
        <td>{{ today_country | default:'' }}{{ today_province | default:'' }}{{ today_city | default:'' }}{{ today_district | default:'' }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>今日学生无人流入疫情重点关注地区</p>
{% endif %}


<h2 id="">重点地区流出情况</h2>

{% if sql_17_tea %}
<p>今日教职工共有{{ sql_17_tea| length }}人流出疫情重点关注地区。具体人员如下：</p>
<table>
    <thead>
    <tr>
        <th>学工号</th>
        <th>姓名</th>
        <th>单位</th>
        <th>身体状况</th>
        <th>手机</th>
        <th>前一日所在日</th>
        <th>现今所在地</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, username, name, faculty_name, health_condition, sj, yesterday_country, yesterday_province, yesterday_city, yesterday_district, today_country, today_province, today_city, today_district in sql_17_tea %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ sj }}</td>
        <td>{{ yesterday_country | default:'' }}{{ yesterday_province | default:'' }}{{ yesterday_city | default:'' }}{{ yesterday_district | default:'' }}</td>
        <td>{{ today_country | default:'' }}{{ today_province | default:'' }}{{ today_city | default:'' }}{{ today_district | default:'' }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>今日教职工无人流出疫情重点关注地区</p>
{% endif %}



{% if sql_17_stu %}
<p>今日学生共有{{ sql_17_stu| length }}人流出疫情重点关注地区。具体人员如下：</p>
<table>
    <thead>
    <tr>
        <th>学工号</th>
        <th>姓名</th>
        <th>单位</th>
        <th>身体状况</th>
        <th>手机</th>
        <th>前一日所在日</th>
        <th>现今所在地</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, username, name, faculty_name, health_condition, sj, yesterday_country, yesterday_province, yesterday_city, yesterday_district, today_country, today_province, today_city, today_district in sql_17_stu %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ sj }}</td>
        <td>{{ yesterday_country | default:'' }}{{ yesterday_province | default:'' }}{{ yesterday_city | default:'' }}{{ yesterday_district | default:'' }}</td>
        <td>{{ today_country | default:'' }}{{ today_province | default:'' }}{{ today_city | default:'' }}{{ today_district | default:'' }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>今日学生无人流出疫情重点关注地区</p>
{% endif %}


<!--                                          离粤、 离莞情况                                          -->
<h3 id="">师生离粤离莞情况</h3>

{% if out_dongguan %}
<p>今日共有{{ out_dongguan| length }}人离开东莞。具体人员如下：</p>
<table>
    <thead>
    <tr>
        <th>学工号</th>
        <th>姓名</th>
        <th>单位</th>
        <th>身体状况</th>
        <th>手机</th>
        <th>前一日所在日</th>
        <th>现今所在地</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, username, name, faculty_name, health_condition, sj, yesterday_city, today_city in out_dongguan %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ sj }}</td>
        <td>{{ yesterday_city }}</td>
        <td>{{ today_city }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>今日无人离开东莞</p>
{% endif %}

{% if out_guangdong %}
<p>今日共有{{ out_guangdong| length }}人离开广东省。具体人员如下：</p>
<table>
    <thead>
    <tr>
        <th>学工号</th>
        <th>姓名</th>
        <th>单位</th>
        <th>身体状况</th>
        <th>手机</th>
        <th>前一日所在日</th>
        <th>现今所在地</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, username, name, faculty_name, health_condition, sj, yesterday_city, today_city in out_guangdong %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ sj }}</td>
        <td>{{ yesterday_city }}</td>
        <td>{{ today_city }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>今日无人离开广东</p>
{% endif %}

<!--=================================================================================================-->



<h2 id="_7">师生返莞时间、方式</h2>
<p>目前在莞师生有{{ at_dg_count }}人，不在莞师生{{ not_at_dg_count }}人。</p>

<!-- <div id="sql_20" style="width: 1000px;height:400px;"></div> -->

<p>不在莞师生已确定返莞时间的有{{ plan_back_dg_count }}人，其中{{ next_month }}月前{{ plan_back_dg_count_beforet }}人，{{ next_month }}月后{{ plan_back_dg_count_aftert }}人。
    最早计划返莞时间{{ first_time_back_dg }}，最晚计划返莞时间{{ last_time_back_dg }}。主要集中在{% for day,count in back_dg_cal_topt %}{{ day }}({{ count }}人) &ensp; {% endfor %} &ensp; </p>
<p>前后两周（后两周为计划回莞）的返莞人数如下图：</p>


<div id="sql_19" style="width: 1000px;height:400px;page-break-inside: avoid;"></div>

<p>各种返莞方式的选择人数如下：</p>

<div id="sql_18" style="width: 1000px;height:400px;page-break-inside: avoid;"></div>

{% if date > '2020-08-19 00:00:00' %}
<h2 id="_7">潜在风险人群</h2>
<p>体温异常（≥37.3℃）的学生列为潜在风险人员。</p>
{% if abnormal_body_temperature_student %}
<p>当前潜在风险人群有学生{{ abnormal_body_temperature_student|length }}人，名单如下：</p>
<table>
    <thead>
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>学院</th>
        <th>班级</th>
        <th>身体状况</th>
        <th>当前体温</th>
        <th>手机</th>
    </tr>
    </thead>
    <tbody>
    {% for submit_time, username, name, faculty_name, class_name, health_condition, body_temperature,sj in abnormal_body_temperature_student %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ class_name }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ body_temperature }}</td>
        <td>{{ sj }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>今日无潜在风险人员</p>
{% endif %}

{% if continuous_abnormal_body_temperature_student %}
<p>连续三天体温异常师生有{{ continuous_abnormal_body_temperature_student|length }}人，名单如下：</p>
<table>
    <thead>
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>学院</th>
        <th>班级</th>
        <th>身体状况</th>
        <th>当前体温</th>
        <th>手机</th>
    </tr>
    </thead>
    <tbody>
    {% for username, name, faculty_name, class_name, health_condition, body_temperature, continuous_days, sj in continuous_abnormal_body_temperature_student %}
    <tr>
        <td>{{ username }}</td>
        <td>{{ name }}</td>
        <td>{{ faculty_name }}</td>
        <td>{{ class_name|default_if_none:'-' }}</td>
        <td>{{ health_condition }}</td>
        <td>{{ body_temperature }}</td>
        <td>{{ sj|default_if_none:'-' }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<p>无连续三天体温异常师生</p>
{% endif %}
{% endif %}

<h2 id="_3">学生进校离校情况</h2>
<p>根据学校各门岗扫码记录统计，今日学生进校人数{{inSchool}}人，学生离校人数{{outSchool}}人。



<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>

<script crossorigin="anonymous" integrity="sha384-RPqk+IZGGuMAN/gBBbPKRtfXRISl/vFqiT13cXlm2vHZtd+xZ7ugm9sDxXDb2Ylk" src="https://lib.baomitu.com/echarts/4.6.0/echarts.min.js"></script>
<script type="text/javascript" src="{% static 'Dashboard/china.js' %}"></script>
<script type="text/javascript" src="{% static 'Dashboard/guangdong.js' %}"></script>

<script>
    [].slice.call(document.querySelectorAll('table')).forEach(function (el) {
        var wrapper = document.createElement('div');
        wrapper.className = 'table-area';
        el.parentNode.insertBefore(wrapper, el);
        el.parentNode.removeChild(el);
        wrapper.appendChild(el);
    })
    $("table").wrap("<div class='table-area'></div>");
</script>
<!--SQL_18绘图-->
<script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('sql_18'));

        // 指定图表的配置项和数据
        var option = {

            tooltip: {},

            xAxis: {
                data: {{ sql_18_1 | safe }}
            },
            yAxis: {},
            series: [{
                name: '人数',
                type: 'bar',
                data: {{ sql_18_2 | safe }}
            }]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    </script>
<!--SQL_19绘图：返莞日期折线图-->
<script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('sql_19'));
        // 指定图表的配置项和数据

option = {
   //用formatter回调函数显示多项数据内容
   tooltip: {
            trigger: 'axis',
            formatter: function (params, ticket, callback) {
              var htmlStr = '';
              var valMap = {};
              for(var i=0;i<params.length;i++){
                var param = params[i];
                var xName = param.name;//x轴的名称
                var seriesName = param.seriesName;//图例名称
                var value = param.value;//y轴值
                var color = param.color;//图例颜色

                //过滤无效值
                if(value == '-'){
                    continue;
                }

                //过滤重叠值
                if(valMap[seriesName] == value){
                    continue;
                }

                if(i===0){
                  htmlStr += xName + '<br/>';//x轴的名称
                }else{
                    htmlStr +=xName;
                    htmlStr +='<br >';
                }

                //为了保证和原来的效果一样，这里自己实现了一个点的效果
                htmlStr +='<div>';
                //if(seriesName.search('-')!=-1)
                //}
                htmlStr += '<span style="margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:5px;background-color:'+color+';"></span>';
                //console.log(xName);
                //圆点后面显示的文本
                htmlStr += seriesName + '：' + value;

                htmlStr += '</div>';
                valMap[seriesName] = value;
              }
              return htmlStr;
             }
        },
       grid: {
           left: '3%',
           right: '4%',
           bottom: '3%',
           containLabel: true
       },
       toolbox: {
           feature: {
               saveAsImage: {}
           }
       },
       xAxis: {
           type: 'category',
           boundaryGap: false,
           data: {{ sql_19| safe }}
           //data: ['2020-01-20', '2020-03-02', '2020-03-03', '2020-03-04', '2020-03-05', '2020-03-06', '2020-03-07', '2020-03-08', '2020-03-09', '2020-03-10', '2020-03-11', '2020-03-15', '2020-03-16', '2020-03-17','2020-01-20', '2020-03-02', '2020-03-03', '2020-03-04', '2020-03-05', '2020-03-06', '2020-03-07', '2020-03-08', '2020-03-09', '2020-03-10', '2020-03-11', '2020-03-15', '2020-03-16', '2020-03-17']
       },
       yAxis: {
           type: 'value'
       },
       series: [
           {
                    name: '人数',
                    type: 'line',
                    smooth:true,   //关键点，为true是不支持虚线，实线就用true
                    data: {{ sql_19_4 | safe }}
           },
           {
               name:'人数',
               type:'line',
               smooth:false,   //关键点，为true是不支持虚线，实线就用true
               itemStyle:{
                   normal:{
                       lineStyle:{
                           width:2,
                           type:'dotted'  //'dotted'虚线 'solid'实线
                       }
                   }
               },

               data:{{ arr_null| safe }}
           },

       ]
    };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    </script>
<!--SQL_20绘图：在莞不在莞人数饼图-->
<script type="text/javascript">

            //// 基于准备好的dom，初始化echarts实例
        //var myChart = echarts.init(document.getElementById('sql_20'));
        //// 指定图表的配置项和数据
        //option = {
        //    title: {
        //        text: '某站点用户访问来源',
        //        subtext: '纯属虚构',
        //        left: 'center',
        //        show: false
        //    },
        //    tooltip: {
        //        trigger: 'item',
        //        formatter: '{a} <br/>{b} : {c} ({d}%)'
        //    },
        //    legend: {
        //
        //        data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎']
        //    },
        //    series: [
        //        {
        //            name: '访问来源',
        //            type: 'pie',
        //            radius: '55%',
        //            center: ['50%', '60%'],
        //            data: [
        //                {value: 335, name: '直接访问'},
        //                {value: 310, name: '邮件营销'},
        //                {value: 234, name: '联盟广告'},
        //                {value: 135, name: '视频广告'},
        //                {value: 1548, name: '搜索引擎'}
        //            ],
        //            emphasis: {
        //                itemStyle: {
        //                    shadowBlur: 10,
        //                    shadowOffsetX: 0,
        //                    shadowColor: 'rgba(0, 0, 0, 0.5)'
        //                }
        //            }
        //        }
        //    ]
        //};
		//
        //// 使用刚指定的配置项和数据显示图表。
        //myChart.setOption(option);

</script>
<!--SQL_21绘图：师生分布地图-->
<script type="text/javascript">

let provinces = {
    //23个省
    "台湾": "taiwan",
    "河北": "hebei",
    "山西": "shanxi",
    "辽宁": "liaoning",
    "吉林": "jilin",
    "黑龙江": "heilongjiang",
    "江苏": "jiangsu",
    "浙江": "zhejiang",
    "安徽": "anhui",
    "福建": "fujian",
    "江西": "jiangxi",
    "山东": "shandong",
    "河南": "henan",
    "湖北": "hubei",
    "湖南": "hunan",
    "广东": "guangdong",
    "海南": "hainan",
    "四川": "sichuan",
    "贵州": "guizhou",
    "云南": "yunnan",
    "陕西": "shanxi1",
    "甘肃": "gansu",
    "青海": "qinghai",
    //5个自治区
    "新疆": "xinjiang",
    "广西": "guangxi",
    "内蒙古": "neimenggu",
    "宁夏": "ningxia",
    "西藏": "xizang",
    //4个直辖市
    "北京": "beijing",
    "天津": "tianjin",
    "上海": "shanghai",
    "重庆": "chongqing",
    //2个特别行政区
    "香港": "xianggang",
    "澳门": "aomen"
};


//初始化echarts实例


//使用制定的配置项和数据显示图表
var china_data = {{ china | safe }}

chart_21 = echarts.init(document.getElementById('sql_21'));
function renderMap(map, data){
    let option = new Object()
	option.backgroundColor = '#FFFFFF'
	option.title = {
        text: '师生分布',
        subtext: map,
        x:'center'
    }
    option.tooltip = {
        trigger: 'item',
        formatter: '{a} <br/>{b} : {c}人'
    }

    //左侧小导航图标
    option.visualMap = {
        show : true,
        x: 'left',
        y: 'center',
        splitList: [
            {start: 10000},
            {start: 200, end: 10000},
            {start: 150, end: 200},
            {start: 100, end: 150},
            {start: 50, end: 100},
            {start: 0, end: 50},
        ],
        color: ['#006400', '#008000', '#32CD32','#00FF00', '#98FB98', '#F0FFF0']
    }

    option.series = [
		{
            name: map,
            type: 'map',
            mapType: map,
            roam: false,
            nameMap:{
			    'china':'中国'
			},
            label: {
	            normal:{
					show:true,
					textStyle:{
						color:'#999',
						fontSize:13
					}
	            },
	        },
            data: data
        }
    ];
    //渲染地图
    chart_21.setOption(option)
}

chart_21.on('click', function (params) {
	if( params.name in provinces ) {
        //如果点击的是34个省、市、自治区，绘制选中地区的二级地图
        $.getJSON('/static/Dashboard/map/province/' + provinces[params.name] + '.json', function (data) {
            console.log(data)
            echarts.registerMap(params.name, data);
            var d = [];
            for (var i = 0; i < data.features.length; i++) {
                d.push({
                    name: data.features[i].properties.name,
                    value: 100
                })
            }
            let provinces_data = {{ province | safe }}
            renderMap(params.name, provinces_data[params.name]);
        });
    } else {
		renderMap('中国', china_data);
	}
})
renderMap('中国', china_data)
</script>
</body>
</html>